Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KYLIN-3997: Add a health check job of Kylin #669

Merged
merged 1 commit into from
Jun 9, 2019

Conversation

lshmouse
Copy link

@asfgit
Copy link

asfgit commented May 31, 2019

Can one of the admins verify this patch?

@codecov-io
Copy link

Codecov Report

Merging #669 into master will decrease coverage by 0.05%.
The diff coverage is 2.94%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #669      +/-   ##
============================================
- Coverage     25.78%   25.73%   -0.06%     
  Complexity     6008     6008              
============================================
  Files          1382     1384       +2     
  Lines         82202    82374     +172     
  Branches      11519    11550      +31     
============================================
- Hits          21198    21197       -1     
- Misses        58958    59129     +171     
- Partials       2046     2048       +2
Impacted Files Coverage Δ Complexity Δ
...in/java/org/apache/kylin/cube/CubeDescManager.java 33.57% <0%> (-0.25%) 12 <0> (ø)
.../java/org/apache/kylin/common/KylinConfigBase.java 13.02% <0%> (-0.03%) 42 <0> (ø)
.../apache/kylin/metadata/model/DataModelManager.java 34.54% <0%> (-0.64%) 12 <0> (ø)
...a/org/apache/kylin/common/util/BufferedLogger.java 0% <0%> (ø) 0 <0> (ø) ⬇️
.../java/org/apache/kylin/common/util/SoutLogger.java 16.66% <0%> (-16.67%) 1 <0> (ø)
...org/apache/kylin/rest/job/KylinHealthCheckJob.java 0% <0%> (ø) 0 <0> (?)
...ava/org/apache/kylin/tool/KylinHealthCheckJob.java 0% <0%> (ø) 0 <0> (?)
...c/main/java/org/apache/kylin/cube/CubeManager.java 37.77% <100%> (-0.26%) 44 <1> (ø)
...che/kylin/metadata/cachesync/CachedCrudAssist.java 56.98% <60%> (+0.17%) 15 <1> (ø) ⬇️
.../apache/kylin/cube/cuboid/TreeCuboidScheduler.java 63.84% <0%> (-2.31%) 0% <0%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 670c2a9...2da08ff. Read the comment docs.

@coveralls
Copy link

coveralls commented May 31, 2019

Pull Request Test Coverage Report for Build 4586

  • 3 of 181 (1.66%) changed or added relevant lines in 8 files are covered.
  • 8 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.06%) to 28.221%

Changes Missing Coverage Covered Lines Changed/Added Lines %
core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java 0 1 0.0%
core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/CachedCrudAssist.java 3 5 60.0%
core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelManager.java 0 2 0.0%
core-common/src/main/java/org/apache/kylin/common/util/BufferedLogger.java 0 3 0.0%
core-common/src/main/java/org/apache/kylin/common/util/SoutLogger.java 0 3 0.0%
tool/src/main/java/org/apache/kylin/tool/KylinHealthCheckJob.java 0 4 0.0%
core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java 0 5 0.0%
server-base/src/main/java/org/apache/kylin/rest/job/KylinHealthCheckJob.java 0 158 0.0%
Files with Coverage Reduction New Missed Lines %
core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/CachedCrudAssist.java 1 64.52%
core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/MemDiskStore.java 7 76.29%
Totals Coverage Status
Change from base Build 4585: -0.06%
Covered Lines: 23247
Relevant Lines: 82376

💛 - Coveralls

@@ -0,0 +1,298 @@
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @lshmouse , I found this java file is not formatted as expected. It looks like it is indented with two blank and it is different with other Java file, maybe you should check Setup IDE code formatter in http://kylin.apache.org/development/dev_env.html.

private void checkStoppedJob() throws Exception {
reporter.log("## Cleanup stopped job");
// TODO: Add a config
long outdatedJobTimeCut = System.currentTimeMillis() - 30 * 24 * 3600 * 1000L;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like that 30 * 24 * 3600 * 1000L is a magic number, could you please add these in KylinConfig?

long cubeDataSize = cube.getSizeKB() * 1024;
double expansionRate = cubeDataSize / sizeRecordSize;
if (sizeRecordSize > 500L * 1024 * 1024 * 1024) {
if (expansionRate > 5.0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5.0 is also a magic number.

@@ -164,6 +164,10 @@ public CubeDesc reloadCubeDescQuietly(String name) {
}
}

public List<String> getErrorCubes() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is duplicated with getErrorCubes in CubeManager.java

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it is never called anywhere.

@hit-lacus
Copy link
Member

I think it is a good feature, by this feature, Kylin's administrator needn't check metadata error in kylin.log or find useless cube manually. Some value such as ExpansionRate or Out of date should be configurable.

@lshmouse
Copy link
Author

lshmouse commented Jun 4, 2019

Thanks for @hit-lacus 's review. I will update the pr asap.

@lshmouse
Copy link
Author

lshmouse commented Jun 6, 2019

Format the code and compress the commits. Please help review the pr one more time, thanks~
@hit-lacus

Copy link

@nichunen nichunen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine to me

@nichunen nichunen merged commit 1fb000e into apache:master Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants